<template>
  <div class="w-[1150px] p-12 print-style relative bg-white">
    <div class="flex justify-between w-full items-center">
      <div class="w-1/3"></div>
      <div class="text-center font-semibold text-4xl w-1/3">装备报废申请单</div>
      <div class="w-1/3"></div>
    </div>
    <div class="flex-1 mt-8">
      <div class="flex justify-center border-solid items-center border-x-0 border-y-2 py-2">
        <div class="w-1/2 flex">
          <div class="w-1/5">装备序列号</div>
          <div class="w-1/5">装备名称</div>
          <div class="w-1/5">品牌</div>
          <div class="w-1/5">规格</div>
          <div class="w-1/5">型号</div>
        </div>
        <div class="w-1/2 flex">
          <div class="w-1/5">单位</div>
          <div class="w-1/5">报废内容</div>
          <div class="w-1/5">登记时间</div>
          <div class="w-1/5">审核状态</div>
          <div class="w-1/5">操作员</div>
        </div>
      </div>
      <div v-for="item in dataList" :key="item" class="flex justify-center items-center py-2">
        <div class="w-1/2 flex">
          <div class="w-1/5">{{ item.equipmentNumber }}</div>
          <div class="w-1/5">{{ item.equipmentName }}</div>
          <div class="w-1/5">{{ item.brand }}</div>
          <div class="w-1/5">{{ item.specifications }}</div>
          <div class="w-1/5">{{ item.model }}</div>
        </div>
        <div class="w-1/2 flex">
          <div class="w-1/5">{{ item.unit }}</div>
          <div class="w-1/5">{{ item.scrapContent }}</div>
          <div class="w-1/5">{{ item.createTime }}</div>
          <div class="w-1/5">{{ statusEnum[item.status].text }}</div>
          <div class="w-1/5">{{ item.createUserName }}</div>
        </div>
      </div>
    </div>
    <div class="pt-5 flex justify-between mt-4 border-solid border-0 border-t-2">
      <div></div>
      <div class="flex">
        <div>打印人：{{ empName }}</div>
        <div class="ml-10">打印时间：{{ dayjs().format('YYYY-MM-DD HH:mm:ss') }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import dayjs from 'dayjs'
import useUserStore from '@/store/user'

const { empName } = useUserStore()
defineProps({
  dataList: {
    type: Array,
    default: () => []
  }
})
const statusEnum = [
  { text: '未审核', color: 'red' },
  { text: '已审核', color: 'green' },
  { text: '已确认', color: 'blue' }
]
</script>
<style lang="less" scoped></style>
